package lab02.test31;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by lenovo on 2017/11/2.
 */
public class Test {
    public static void main(String[] args) {
        //数组：量词、三个单词、五个学生、十个手机
        //十个整数
        int[] numbers=new int[10];
        //集合：List,Set,Map

       /* List<Integer> list= new ArrayList<Integer>();
        list.add(10);
        list.add(12);
        list.add(14);
        list.add(16);
        for (Integer num:list){
            System.out.println(num);
        }*/
        List<String> names=new ArrayList<>();
        names.add("张三");
        names.add("李四");
        names.add("王五");
        names.add("马六");
        names.add("赵七");
        for (String name:names){
            System.out.println(names.indexOf(name)+"|"+name);
        }
        System.out.println("集合的大小：" +names.size());
        names.remove(2);
        String delNanme=names.remove(2);
        System.out.println("删除的第三个元素："+delNanme);
        System.out.println(names.get(2));
        }

    }

